﻿@model DataModel.Models.ScheduleModel
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@{
    string[] weekdays = { "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" };   
}

<link type="text/css" href="@Url.Content("~/content/schedule-edit.css")" rel="stylesheet" />
<script src="@Url.Content("~/Scripts/schedule-edit.js")" ></script>

<h3>Group @Model.GroupNumber.ToString() </h3>

<div class="filter">
        <input type="button" class="btn se-newlesson" value="+ New"/>
</div>
<div class="se-wrapper">
    <div class="se-lesson-edit">

    </div>
</div>

<div class="se-wrapper doublescroll">
        <div class="schedule-edit">
            <div class="se-lesson se-header">
                <div class="se-cell"></div>
                <div class="se-cell">Weekday</div>
                <div class="se-cell">BeginTime</div>
                <div class="se-cell">EndTime</div>
                <div class="se-cell">Subject</div>
                <div class="se-cell">Lector</div>
                <div class="se-cell">Auditory</div>
                <div class="se-cell">LessonType</div>
                <div class="se-cell">Periodicity</div>
                <div class="se-cell">PeriodisityMask</div>
                <div class="se-cell">BeginDate</div>
                <div class="se-cell">EndDate</div>
                <div class="se-cell">Semester</div>
            </div>
            @for (var i = 0; i < Model.dayModels.Count; i++)
            {
                <div class="se-lesson ">
                    <div class="se-cell se-weekday-title">@weekdays[i]</div>
                </div>
                foreach (var lesson in Model.dayModels[i].lessonModels)
                {
                <div class="se-lesson" id="@lesson.LessonID.ToString()">
                    <div class="se-cell"                ><button class="btn se-edit">✎ Edit</button></div>
                    <div class="se-cell se-weekday"     >@lesson.WeekDay</div>
                    <div class="se-cell se-begintime"   >@lesson.BeginTime.ToShortTimeString()</div>
                    <div class="se-cell se-endtime"     >@lesson.EndTime.ToShortTimeString()</div>
                    <div class="se-cell se-sname"       >@lesson.Subject.shortName</div>
                    <div class="se-cell se-professor"   >@lesson.Professor.User.lastName</div>
                    <div class="se-cell se-auditory"    >@lesson.Auditory.FullName</div>
                    <div class="se-cell se-lessontype"  >@lesson.LessonType.name</div>
                    <div class="se-cell se-perioditity" >@lesson.Periodicity</div>
                    <div class="se-cell se-permask"     >
                        @{ 
                    var periodicityMask = (new DataModel.Managers.SubManage.PeriodicityHelper()).GetBoolMask(lesson.Periodicity, lesson.PeriodicityMask);
                            @Html.DisplayFor(x => periodicityMask);
                                                                  //for (var j = 0; j < periodicityMask.Length; j++ )
                                                                  //{
                                                                  //    @Html.EditorFor(x => periodicityMask[j]);
                                                                  //}
                        }
                    </div>
                    <div class="se-cell se-begindate">@lesson.BeginDate.ToShortDateString()</div>
                    <div class="se-cell se-enddate">@lesson.EndDate.ToShortDateString()</div>
                    <div class="se-cell se-semester">@lesson.Semester</div>
                </div>
                }
            }
        </div> 
</div>


